import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 移除登录状态
    // isLoggedIn: localStorage.getItem('isLoggedIn') === 'true'
    selectedDocumentItems: null // 添加状态来存储选中的文档items
  },
  getters: {
    getSelectedDocumentItems: state => state.selectedDocumentItems
  },
  mutations: {
    // 移除设置登录状态的 mutation
    // SET_LOGGED_IN(state, value) {
    //   state.isLoggedIn = value;
    //   localStorage.setItem('isLoggedIn', value);
    // }
    SET_SELECTED_DOCUMENT_ITEMS(state, items) {
      state.selectedDocumentItems = items;
    }
  },
  actions: {
    setSelectedDocumentItems({ commit }, items) {
      commit('SET_SELECTED_DOCUMENT_ITEMS', items);
    }
  },
  modules: {
  }
})
